Imports System.Windows.Forms
Imports System
Imports System.Net.Mail

Public Class frmErrorDisplay


    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub txtError_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtError.TextChanged

    End Sub

    Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
        Try
            'Dim oEmail As New SendMail.SendMail
            Dim EmailBody As String = ""
            Cursor = Cursors.WaitCursor
            Application.DoEvents()
            EmailBody = CurrentUser & " " & vbCrLf & txtError.Text & vbCrLf & txtExtra.Text
            Application.DoEvents()
            'Debug.Print(oEmail.SendSMTPMail("Please", "Error: " & NetWorkUserID, EmailBody, NetWorkUserID.Trim & "@AvivaGroup.com.au"))

        Catch ex As Exception
            MsgBox("Error: " & ex.Message)
        End Try
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
        Cursor = Cursors.Default
    End Sub

    Private Sub frmErrorDisplay_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load       
        'Dim oEmail As New SendMail.SendMail
        Dim EmailBody As String = ""
        EmailBody = CurrentUser & " " & vbCrLf & txtError.Text & vbCrLf & txtExtra.Text
        Application.DoEvents()
        If My.Application.Info.AssemblyName <> "RIBS.01Development" Then
            'oEmail.SendSMTPMailAsync("Please", "Error: " & NetWorkUserID, EmailBody, NetWorkUserID.Trim & "@AvivaGroup.com.au")
        End If        
        Cursor = Cursors.Default
    End Sub

  
End Class
